#include <spriteViewerMode.h>

#include <foun/debug.h>

#include <file/systemAccessor.h>
#include <file/packedAccessor.h>

#include <imag/resourceHandler.h>

#include <font/resourceHandler.h>

/*
 * Internal Constants
 */

/*
 * Public Instance
 */
SpriteViewerMode::SpriteViewerMode()
: Mode()
, m_pAccessor(NULL)
, m_pCursor(NULL)
, m_pImageResourceHandler(NULL)
, m_pFillDrawContext(NULL)
, m_pFontAssetContainer(NULL)
, m_pFontResourceHandler(NULL)
, m_pFontDrawContext(NULL)
, m_pSpriteDrawContext(NULL)
{
}

SpriteViewerMode::~SpriteViewerMode()
{
}

void SpriteViewerMode::SetAccessor(lct::file::Accessor* pAccessor)
{
	m_pAccessor = pAccessor;
}

void SpriteViewerMode::SetCursor(lct::inpu::Cursor* pCursor)
{
	m_pCursor = pCursor;
}

void SpriteViewerMode::SetImageResourceHandler(lct::imag::ResourceHandler* pResourceHandler)
{
	m_pImageResourceHandler = pResourceHandler;
}

void SpriteViewerMode::SetFillDrawContext(lct::fill::DrawContext* pDrawContext)
{
	m_pFillDrawContext = pDrawContext;
}

void SpriteViewerMode::SetFontAssetContainer(lct::font::AssetContainer* pAssetContainer)
{
	m_pFontAssetContainer = pAssetContainer;
}

void SpriteViewerMode::SetFontResourceHandler(lct::font::ResourceHandler* pResourceHandler)
{
	m_pFontResourceHandler = pResourceHandler;
}

void SpriteViewerMode::SetFontDrawContext(lct::font::DrawContext* pDrawContext)
{
	m_pFontDrawContext = pDrawContext;
}

void SpriteViewerMode::SetSpriteDrawContext(lct::spri::DrawContext* pDrawContext)
{
	m_pSpriteDrawContext = pDrawContext;
}

void SpriteViewerMode::Init()
{
	Mode::Init();
}

void SpriteViewerMode::AcquireGraphics()
{
	Mode::AcquireGraphics();

	LCT_TRACE("SpriteViewerMode::AcquireGraphics Image Texture Resource Count: %u\n", m_pImageResourceHandler->GetTextureResourceCount());
	LCT_TRACE("SpriteViewerMode::AcquireGraphics Font Quad Resource Count: %u\n", m_pFontResourceHandler->GetQuadResourceCount());
}

void SpriteViewerMode::ReleaseGraphics()
{
	LCT_TRACE("SpriteViewerMode::ReleaseGraphics Image Texture Resource Count: %u\n", m_pImageResourceHandler->GetTextureResourceCount());
	LCT_TRACE("SpriteViewerMode::ReleaseGraphics Font Quad Resource Count: %u\n", m_pFontResourceHandler->GetQuadResourceCount());

	Mode::ReleaseGraphics();
}

/*
 * Protected Instance
 */
